package com.bwda.dsrs.systemservice.domain.form.user;

import com.bwda.dsrs.base.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
 * 用户表
 *
 * @author youzhen
 * @date 2019年4月28日
 */
@Data
@ApiModel(description = "用户表")
public class UserUpdateForm {

	@ApiModelProperty(value = "用户ID", required = true)
	@NotNull(message = "用户ID不能为空")
	private Integer userId;

	@ApiModelProperty(value = "用户编码")
	private String userCode;

	@ApiModelProperty(value = "姓名")
	private String userName;

	@ApiModelProperty(value = "工号")
	private String empNo;

	@ApiModelProperty(value = "密码")
	private String password;

	@ApiModelProperty(value = "组织ID")
	private Integer orgId;

	@ApiModelProperty(value = "用户角色")
	private Integer[] userRole;

	@ApiModelProperty(value = "手机号码")
	private String mobilePhone;

	@ApiModelProperty(value = "邮箱地址")
	private String email;

	@ApiModelProperty(value = "用户职级")
	private Integer userLevel;

	@ApiModelProperty(value = "备注")
	@Size(min = 0, max = 512 ,message = "最长不超过512，请重新输入！")
	private String remark;

	@ApiModelProperty(value = "0正常1冻结2离职3锁定4注销")
	private Integer userState;

	@ApiModelProperty(value = "历史密码1")
	private String hisPwdOne;

	@ApiModelProperty(value = "历史密码2")
	private String hisPwdOtwo;

	@ApiModelProperty(value = "创建时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date createTime;

	@ApiModelProperty(value = "创建人编号")
	private String createUserCode;

	@ApiModelProperty(value = "更新时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date updateTime;

	@ApiModelProperty(value = "更新人编号")
	private String updateUserCode;

	@ApiModelProperty(value = "0未删除 1已删除")
	private Integer delFlag;

	@ApiModelProperty(value = "0女1男")
	private Integer sex;

	@ApiModelProperty(value = "出生日期,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date bornDate;

	@ApiModelProperty(value = "籍贯")
	private String nativePlace;

	@ApiModelProperty(value = "身份证，男女出生日期以身份证为准")
	private String identityCard;

	@ApiModelProperty(value = "学历")
	private String degree;

	@ApiModelProperty(value = "毕业学校")
	private String graduateSchool;

	@ApiModelProperty(value = "固定电话")
	private String telphone;

	@ApiModelProperty(value = "传真")
	private String fax;

	@ApiModelProperty(value = "工作职业")
	private String profession;

	@ApiModelProperty(value = "工作岗位")
	private String jobPost;

	@ApiModelProperty(value = "职务")
	private String position;

	@ApiModelProperty(value = "办公地址")
	private String officeAddress;

	@ApiModelProperty(value = "公司名称")
	private String companyName;

	@ApiModelProperty(value = "公司地址")
	private String companyAddress;

	@ApiModelProperty(value = "家庭住址")
	private String homeAddress;

	public Integer[] getUserRole() {
		Integer[] temp = userRole;
		return temp;
	}

	public void setUserRole(Integer[] userRole) {
		Integer[] temp = userRole;
		this.userRole = temp;
	}

	public Date getCreateTime() {
		if (createTime != null){
			return (Date) createTime.clone();
		}

		return null;
	}

	public void setCreateTime(Date createTime) {
		if (createTime != null){
			this.createTime = (Date) createTime.clone();
		}
	}

	public Date getUpdateTime() {
		if (updateTime != null){
			return (Date) updateTime.clone();
		}

		return null;
	}

	public void setUpdateTime(Date updateTime) {
		if (updateTime != null){
			this.updateTime = (Date) updateTime.clone();
		}
	}

	public Date getBornDate() {
		if (bornDate != null){
			return (Date) bornDate.clone();
		}

		return null;
	}

	public void setBornDate(Date bornDate) {
		if (bornDate != null){
			this.bornDate = (Date) bornDate.clone();
		}
	}
}